<?php

namespace App\Models;

use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;

class ProductCenter extends BaseModel
{
    use HasFactory;
    protected $table = 'product_center';
    // 允许批量操作的字段
    protected $fillable = ['product_id','pid','specification_id','job_type_id','model_number_id','price','created_at','updated_at'];


    public function scopeSearch($query,$params)
    {
        return $query;
    }

    public function job_type(){
        return $this->hasOne(JobType::class,'id','job_type_id');
    }

    public function product(){
        return $this->hasOne(Product::class,'id','product_id');
    }
}
